package com.ftg.learn.controller;

import com.ftg.learn.service.AiServiceKjx;
import dev.langchain4j.service.TokenStream;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

import java.io.IOException;

@RestController
public class ChatDemoController {

    @Resource
    private AiServiceKjx aiService;


    @GetMapping("/say2")
    public String say2(@RequestParam("message") String message) {
        return aiService.chat(message);
    }

}
